Lossy significance compression with lossy restoration

ABSTRACT

Described are systems and methods for lossy compression and restoration of data. The raw data is first truncated. Then the truncated data is compressed. The compressed truncated data can then be efficiently stored and/or transmitted using fewer bits. To restore the data, the compressed data is then decompressed and restoration bits are concatenated. The restoration bits are selected to compensate for statistical biasing introduced by the truncation.

BACKGROUND

Computer memories, caches, and links are designed to be lossless inorder to exactly reproduce stored information. However, in someapplications such as machine learning, exact values are not required. Infact, in many of these circumstances using exact values results indiminished performance of the machine learning system without anyadditional benefit.

BRIEF DESCRIPTION OF THE DRAWINGS

A more detailed understanding may be had from the following description,given by way of example in conjunction with the accompanying drawingswherein:

FIG. 1 is a block diagram of an example device in which one or moredisclosed implementations may be implemented;

FIG. 2A is a block diagram of a compression unit according to anexample;

FIG. 2B is a block diagram of a restoration unit according to anexample;

FIG. 2C is an example flow diagram of a technique to compress data;

FIG. 2D is an example flow diagram of a technique to restore compresseddata;

FIG. 3 is an example of data compression that is implemented usingdictionary-based frequent value compression (FVC) alone;

FIG. 4 is an example of data compression and restoration according tocertain implementations;

FIG. 5A is a block diagram of a machine learning system that utilizesthe restoration unit for evaluation;

FIG. 5B is a block diagram of a machine learning system that utilizesthe compression unit and restoration unit for training;

FIG. 6A is an example flow diagram of a machine learning technique toperform an evaluation; and

FIG. 6B is an example flow diagram of a machine learning technique toperform training.

DETAILED DESCRIPTION

The present disclosure is directed to techniques for lossy compressionand restoration of data. According to the technique, the raw data istruncated. Then the truncated data is compressed. The compressedtruncated data can then be efficiently stored and transmitted usingfewer bits. To restore the data, the compressed data is decompressed.Restoration bits are then added to the decompressed data. In someimplementations, the restoration bits are selected to compensate forstatistical biasing introduced by the truncation.

The systems and methods for lossy compression and restoration of datadisclosed can be applied to Central Processing Units (CPUs), GraphicsProcessing Units (GPUs), Accelerated Processing Units (APU), FieldProgrammable Gate Arrays (FPGAs), or any other processing device thatutilizes memory, caches and interconnects. In some instances, thetechniques for lossy compression and restoration of data may be used formemory compression, cache compression, register file compression, linkcompression, and other instances of data transmission and storage.

In many machine learning systems, workloads are bottlenecked by memory.Specifically, many machine learning workloads involve using anartificial neural network to generate one or more prediction scoresbased on one or more input values. Processing through the artificialneural network involves calculation of transfer functions for eachneuron, with inputs to each neuron biased based on adjustable weights.In large neural network systems, the large number of neurons, and thusweights, results in a large amount of data transferred betweenprocessing units and memory. Specifically, in the course of generating aprediction, a large number of neuron weights may be transmitted betweenmemory and the processing units. This fact can result in memorybandwidth being a bottleneck for the speed with which such predictionsare generated.

An effective compression technique can be used to reduce the amount ofdata that is transmitted between the processing units and the memory.This technique takes advantage of the fact that neuron weights oftenhave a “satisfactory” precision. Values that are more precise than thisprecision provide little or no additional accuracy to the predictivemodel. The technique thus involves truncating weight values to a certainprecision and then compressing the result. A favorable technique forcompression is a frequent value compression technique. In thistechnique, identical values in a dataset are replaced with key values ina dictionary. Truncation of weight values to certain precision allowsfor a dictionary to be constructed based on the more significant bits ofthe weight values, which results in a higher likelihood that particularweight values can actually be replaced with dictionary values.Restoration of the weight values involves decompressing the compressedvalues and then restoring the decompressed values with restoration bitsin the least significant bits. The specific restoration bits that areused may be fixed bits (such as the value 0), random bits, or may beselected according to any technically feasible technique. Random bitsprovide a benefit in that random bits reduce the bias towards certainvalues that could be introduced with fixed bits. Fixed bits provide thebenefit of ease of implementation. Additional details are providedbelow.

FIG. 1 is a block diagram of an example device 100 in which one or moreaspects of the present disclosure are implemented. The device 100includes, for example, a computer (such as a server, desktop, or laptopcomputer), a gaming device, a handheld device, a set-top box, atelevision, a mobile phone, or a tablet computer. The device 100includes a processor 102, a memory 104, a storage device 106, one ormore input devices 108, and one or more output devices 110. The device100 optionally includes an input driver 112 and an output driver 114. Itis understood that the device 100 optionally includes additionalcomponents not shown in FIG. 1.

The processor 102 includes one or more of: a central processing unit(CPU), a graphics processing unit (GPU), a CPU and GPU located on thesame die, or one or more processor cores, wherein each processor core isa CPU or a GPU. The memory 104 is located on the same die as theprocessor 102 or separately from the processor 102. The memory 104includes a volatile or non-volatile memory, for example, random accessmemory (RAM), dynamic RAM, or a cache.

The storage device 106 includes a fixed or removable storage, forexample, a hard disk drive, a solid state drive, an optical disk, or aflash drive. The input devices 108 include one or more of a camera,keyboard, a keypad, a touch screen, a touch pad, a detector, amicrophone, an accelerometer, a gyroscope, or a biometric scanner. Theoutput devices 110 include one or more of a display, a speaker, aprinter, a haptic feedback device, one or more lights, or an antenna.

The input driver 112 communicates with the processor 102 and the inputdevices 108 and permits the processor 102 to receive input from theinput devices 108. The output driver 114 communicates with the processor102 and the output devices 110 and permits the processor 102 to sendoutput to the output devices 110.

A compression unit 105 and a restoration unit 103 are shown in severaldifferent forms. The compression unit 105 receives data and outputscompressed data. The restoration unit 103 receives compressed data andoutputs restored data. In a first form, the compression unit 105 and therestoration unit 103 are software that is stored in the memory 104 andthat executes on the processor 102 as shown. In this form, when notbeing executed, the compression unit 105 and/or restoration unit 103 maybe stored in storage 106. In a second form, the compression unit 105 anda restoration unit 103 are at least a portion of a hardware engine thatresides in output drivers 114. In other forms, the compression unit 105and a restoration unit 103 are a combination of software and hardwareelements, with the hardware residing, for example, in output drivers114, and the software executed on, for example, the processor 102. Thecompression unit 105 stores the compressed data in memory, such as inmemory 104, or any other memory such as a buffer stored in or associatedwith a hardware implementation of the compression unit 105, or any othermemory. Similarly, the restoration unit 103 retrieves the compresseddata from memory, restores the data to a restored state, and providesthe restored data to other components within the device 100. Althoughthe compression unit 105 and restoration unit 103 are described incertain example modes of implementation, it should be understood thatthe principles of compression and restoration could be used in anycontext where such compression and/or restoration makes sense. Inaddition, in any particular implementation, compression, restoration, orboth compression and restoration as described herein may be implemented.

In some instances, the processor 102 implements a set of instructions toload and store data using the compression unit 105 and/or therestoration unit 103. If the processor 102 transmits a lossy store tothe compression unit 105, along with data to be stored in a lossymanner, then the compression unit 105 performs the techniques describedherein for truncating and compressing data, which is then output forstorage. If the processor 102 transmits a lossy load instruction to therestoration unit 103, specifying compressed data to be loaded in a lossymanner, then the restoration unit 103 fetches the compressed data,performs the decompression and restoration techniques, and provides thedecompressed, restored data back to the processor 102 for use.

In another example, the compression and decompression are used for cachecompression. In this example, when the processor 102 executes a lossyload instruction (which targets one or more registers), the compressionunit 105 fetches (e.g., from a backing memory), truncates, andcompresses a cache line and stores the compressed cache line in thecache. Then the cache transmits a compressed version of the requesteddata to the processor 102 for processing. The processor includes arestoration unit 103 that restores the data before being placed in itsregisters. When the processor executes a lossy store instruction, thevalue in the registers are recompressed by the compression unit 105, andthese compressed values are stored in the cache. When a cache writebackoccurs, a restoration unit 103 restores the data and places that data ina backing memory.

In other instances, upon receipt of the lossy load instruction, thecache reads the data from the cache, compresses it with compression unit105, and delivers the compressed data back to the processor 102. Theprocessor 102 then utilizes restoration unit 103 to restore thedecompressed data.

Although it is stated that the processor 102 can implement theseinstructions, any processing unit, including those described and notdescribed in the present disclosure, can implement and execute either orboth of these instructions. Further, in different implementationscompressed data may be used in the cache only, in the backing memoryonly or a combination of both the cache and the backing memory. Theabove described techniques for storing and using compressed data in acache are examples only and it should be understood that the compressionunit 105 and restoration unit 103 may be used in any technicallyfeasible manner to compress and restore data for use by a processor andstorage in a cache or in a backing memory.

FIG. 2A is a block diagram of an example compression unit 105. Thecompression unit 105 includes a truncation unit 202 coupled to acompression engine 204. In some instances, the truncation unit 202 andthe compression engine 204 are implemented as fixed function circuity.In other instances, the truncation unit 202 and the compression engine204 are implemented as software or firmware executing on a processor. Inyet other instances, the truncation unit 202 and the compression engine204 are implemented as a combination of fixed function circuity andsoftware.

Raw data 405 is received by the truncation unit 202. In some instances,the raw data 405 is retrieved from the memory 104, the storage device106, the input driver 112 or a cache line. The truncation unit 202 formstruncated data 410 by truncating bits of each fixed-sized piece of data(e.g., word) in the raw data 405. In some implementations, each fixedsize piece of data is the same size as a word in the computer system inwhich the compression unit 105 is included. In examples, this size is 32bits. In other examples, the fixed size pieces of data processed by thecompression unit 105 are a different size than the size as a word in thecomputer system in which the compression unit 105 is included. Anytechnically feasible size for the fixed-size piece of data may be used.

The number of bits truncated by the truncation unit 202 is set by aparameter k. In some instances, the parameter k is a software-definedargument. If defined via software, it could be stored in a portion ofthe memory 104. Alternatively, the parameter can be passed to thetruncation unit 202 as an argument to an instruction (for example, alossy store instruction) (either through a register argument or as animmediate value) from the processor 102 or the output driver 114.

In one implementation, when the compression unit 105 is used in amachine learning system, such as machine learning system 500B, themachine learning system can pass a gradually decreasing value of k tothe compression unit 102 as the training process brings the neuralnetwork model closer to a final state. By gradually reducing the valueof k to incrementally tradeoff compression density for algorithmicprecision, processing speed in early stages of training, where highprecision is not necessary, can be increased. Later—e.g., after acertain number of training iterations, the parameter k can be reduced toimprove precision of the predictive model. In other instances, theparameter k is modified based on convergence criteria or other dynamicmetrics associated with the machine learning algorithm.

In other instances, the parameter k is determined based on the availableresources of the device 100. In other instances, k is a fixed number. Inyet other instances, the parameter k is dynamically determined based onpreviously compressed data For example, an initial value of k may beused to compress the data. The compressed data is then analyzed todetermine the effect of a larger k value. If the effect is below apredetermined threshold, the larger value of k is then used by thecompression unit 105.

The truncated data 410 is then received by the compression engine 204.The compression engine 204 executes a compression algorithm on thetruncated data 410 to form the compressed data 415. In some instances,the compression algorithm uses dictionary-based frequent valuecompression (FVC). In other instances, run-length compression,Huffman-based compression, or base-delta compression may be used. Inalternative implementations, any technically feasible compressionalgorithm or combinations of algorithms may be used. The compressed data415 is then output to other components within the device 100.

FIG. 2B is a block diagram of an example restoration unit 103. Therestoration unit 103 includes a decompression unit 206 coupled to arestoration unit 208. In some instances, the decompression unit 206 andthe restoration unit 208 are implemented as fixed function circuity. Inother instances, the decompression unit 206 and the restoration unit 208are implemented by a processor executing software or firmware. In yetother instances, the decompression unit 206 and the restoration unit 208are implemented as a combination of fixed function circuity andprocessor implemented software.

Compressed data 415 is received by the decompression unit 206. In someinstances, the compressed data 415 is retrieved from the memory 104, thestorage device 106, the input driver 112 or a cache line. Thedecompression engine 206 executes a decompression algorithm on thecompressed data 415 to form decompressed truncated data 420. The type ofdecompression performed is determined based on the type of compressionused by the compression unit 105. For example, when FVC compression isused, the decompressed truncated data is formed based upon thedictionary 435.

The decompressed truncated data 420 is then received by the restorationunit 208. The restoration unit 208 selects restoration bits 425. Therestoration unit 208 then concatenates the restoration bits 425 to thedecompressed truncated data 420 to form restored data 430. The restoreddata 430 is then outputted to other components within the device 100.

The number of restoration bits 425 is equal to the parameter k. In someinstances, truncated data 420 selects restoration bits 425 that arefixed value such as all zeros. However, using a fixed value such as allzeroes biases the data by rounding the data towards negative infinity. Ahigher value such as “FF” would round the data towards positiveinfinity. In either case, a shift in the values is introduced by thefixed technique. Introducing random values helps alleviate this biasing.

As a result, in other instances, the restoration unit 208 selectsrestoration bits 425 using a stochastic restoration process. In thestochastic restoration statistical techniques are used to select therestoration bits 425.

In an example, the stochastic restoration process uses a pseudo-randomnumber generator to generate the restoration bits 425. In otherimplementations, the restoration unit 208 implements the stochasticrestoration process by sampling values from a probability distribution.In some instances, the probability distribution is parametric. Anexample of a parametric probability distribution that may be used is thePoisson Distribution. In these instances, restoration unit 208determines the parameters of the parametric distribution by retrievingthe parameters from a memory or dynamically determining the values basedupon previously restored data. In other instances, the restoration unit208 utilizes a non-parametric probability distribution. In someinstances, the non-parametric distribution is pre-defined and retrievedfrom memory by the restoration unit 208. In other instances, thenon-parametric distribution is dynamically determined by restorationunit 208 based upon previously restored data. For example, Markov chainsand Bayesian networks can be formed using the previously restored data.

In some instances, the restoration unit 208 selectively performs thestochastic restoration process. For example, it may not be desirable toperform the stochastic restoration on a zero value. Accordingly, in thisinstance the restoration unit 208 does not perform the stochasticrestoration process and instead selects restoration bits that are allzero. More specifically, in some implementations, the uncompressed valueis 0, and the truncated value is therefore also 0. When this value isencountered, instead of stochastically selecting restoration bits 425 insuch a circumstance, the restoration unit 208 selects 0 values for therestoration bits 425 so that the result is a 0 value. The reason fordoing this is that if the original data is 0, it may not be appropriateto restore the data to a value other than 0, which would occur if randombits were restored to the lowest-order places.

FIG. 2C is a flow diagram of a process 200C that is implemented by thecompression unit 105. In step 211 the raw data 405 is received. In someinstances, the raw data 405 is retrieved from the memory 104, thestorage device 106 or the input driver 112.

Optionally in step 212, the number of k bits to truncate are determined.In some instances, the parameter k is a software-defined argument. Whenk is software defined, the value is retrieved from the memory 104 or ispassed to the truncation unit 202 via an argument from the processor 102or the output driver 114. In other instances, k is a fixed number.

In yet other instances, the parameter k is dynamically determined basedon previously compressed data. For example, an initial value of k may beused to compress the data. The compressed data is then analyzed todetermine the effect of a larger k value. If the effect is below apredetermined threshold, the larger value of k is then determined as theoutput of step 212.

Then in step 213, the raw data 405 is truncated to form truncated data410. The raw data 405 is truncated by truncating the k bits of eachfixed-sized piece of data (e.g., word) in the raw data 405. In someimplementations, each fixed size piece of data is the same size of aword in the computer system in which the compression unit 105 isincluded. In examples, this size is 32 bits. In other examples, thefixed size pieces of data processed by the compression unit 105 are adifferent size than the size of a word in the computer system in whichthe compression unit 105 is included. Any technically feasible size forthe fixed-size piece of data may be used.

Next, in step 214 the truncated data 410 is compressed to formcompressed data 415. In many instances, step 214 is performed by thecompression engine 204. In some instances, the compression in step 330is performed using dictionary-based frequent value compression (FVC). Inalternative implementations, any technically feasible compressionalgorithm may be used.

These compression algorithms operate by analyzing a block of data andfinding repeated values that can be re-encoded more efficiently. Byimplementing the compression on the truncated data 410, the compressionalgorithms are able to locate patterns of spatially local values in thedata that have similar values but not precisely the same value.Traditionally, compression algorithms struggle with such patternsbecause while the values are similar, they are not exactly the same (orsufficiently the same depending on the exact compression algorithm).Therefore, the compression algorithms are rendered less effective.

Then in step 215 the compressed data 415 is transmitted. In someinstances, the compressed data 415 is transmitted to the memory 104, thememory 104, the storage device 106 or the output driver 114.

FIG. 2D is a flow diagram of a restoration process 200D. In step 221,the compressed data 415 generated by the process 200C is received. Insome instances, the compressed data 415 is retrieved from the memory104, the storage device 106 or the input driver 112.

In step 222, the compressed data 415 is decompressed to formdecompressed truncated data 420. The type of decompression performed isdetermined based on the type of compression used in step 214. Forexample, when FVC compression is used, the decompressed truncated datais formed based upon the dictionary 435.

Next in step 223, restoration bits 425 are concatenated to thedecompressed truncated data to form restored data 430. The number ofrestoration bits 425 is equal to the parameter k. In some instances, therestoration bits 425 are all zeros. In other instances, a stochasticrestoration process is used to determine the restoration bits. In thestochastic restoration statistical techniques are used to select therestoration bits 425

In some implementations, the stochastic restoration process uses apseudo-random number generator. In other implementations, the stochasticrestoration process includes sampling values from a probabilitydistribution. In some instances, the probability distribution isparametric. For example, the distribution a Poisson Distribution. Inthese instances, the parameters of the parametric distribution may bepre-determined or dynamically determined based upon previously restoreddata. In other instances, the probability distribution may benon-parametric. In some instances, the non-parametric distribution canbe pre-defined, and in other instances, the non-parametric distributionis dynamically determined based upon previously restored data. Forexample, Markov chains and Bayesian networks can be formed using thepreviously restored data. By implementing a stochastic restorationprocess the statistical biasing introduced by the truncation in step 320is reduced.

Then in step 224, the restored data 430 is transmitted. In someinstances, the restored data 430 is transmitted to the processor 102,the memory 104, the storage device 106 or the output driver 114.

FIG. 3 illustrates an example where FVC is used alone.

In FVC, patterns of data are identified and stored in a dictionary (suchas dictionary 435). Instead of the entire data pattern being stored inthe memory, an index to the dictionary entry is stored in the memory.More specifically, the FVC algorithm identifies commonly occurringpatterns and creates keys for those patterns. The relationship of eachpattern to each key is stored in a dictionary. By storing only the keyto the pattern in the memory, fewer bits of memory are required. Fordecompression, the data is retrieved from the memory, and the patternstored in the dictionary is restored using the dictionary key. Thisrestoration is done for each key in the compressed data, so that in therestored data, the keys are replaced with the dictionary values, therebyrestoring the data to an uncompressed form.

In example of FVC shown in FIG. 3, the raw data 305 consists of 256 bitsthat includes eight 32-bit words. In this example, each of the original32-bit words is replaced with a 2-bit code 310 if the word can becompressed (that is, if there is a dictionary value that matches the32-bit word). Words may be uncompressed if their values are sufficientlyinfrequently used such that including those values in the dictionarywould not result in a net loss in total data stored. The 2-bit code 310indicates either that the value is uncompressed (00) or that it iscompressed and the 2-bit code specifies which one of up to threedictionary entries 315 are utilized. In this example, due to thediversity of values and the limited dictionary size, only a few of the32-bit words can be compressed. Therefore, the example shows 208 bitsare required when using FVC alone.

FIG. 4 illustrates an example that demonstrates the improved efficiencyof process 200C. In this example, raw data 405 is received according tostep 211. In this example, the raw data 405 consists of 256 bits thatrepresent eight 32-bit words. In step 212, parameter k is set to 2, andthe least significant bits are truncated. The raw data 405 is thentruncated according to step 213 to form truncated data 410. Thetruncated data 410 is then compressed according to step 214 to formcompressed data 415. In this example, FVC compression is used with adictionary 435 in step 214. By applying process 300C to the raw data405, only 40 bits are required as compared to 208 bits when using FVCalone.

FIG. 4 further illustrates the restoration of the compressed data 415according to the restoration process 200D. In step 221 the compresseddata 415 is received. Then the compressed data 415 is decompressedaccording to step 222 to form decompressed truncated data 420. In thisexample, decompression is performed using FVC and dictionary 435.Restoration bits 425 are then concatenated to the decompressed truncateddata 420 to form restored data 430 according to step 335.

FIG. 5A is a block diagram of a machine learning system 500A thatutilizes the restoration unit 103 for evaluation. The system 500Aincludes database 502 of weights. The weights stored in the database 502assign a relative importance to each of a plurality of inputs receivedby neuron nodes in the evaluator 504.

The restoration unit 103 receives the weights from the database 502 asan input. The restoration unit 103 then performs process 200D to producerestored data that is transmitted to the evaluator 504.

The evaluator 504 receives the restored weights from the restorationunit 103. The evaluator 504 is composed of a plurality of interconnectedneuron nodes. Each of the interconnected neurons receives a plurality ofinputs from other neuron nodes or an input source 506. Then each neuronnode computes an individual output based on the weights received fromthe database 502 and the transfer functions 508. The evaluator 504outputs a prediction data 510 based on the individual output of each ofthe plurality of interconnected neuron nodes.

FIG. 5B is a block diagram of a machine learning system 500B thatutilizes the compression unit 105 and restoration unit 103 for training.The machine learning system 500B includes a trainer 514 that determinesweights to be stored in the database 502 based on training data 512. Thetrainer 514 determines the weights by comparing the prediction datagenerated by the evaluator 504 to predetermined outputs for trainingdata. The trainer 514 adjusts the weights based on a feedback mechanism.

Once determined by the trainer 514, the weights are stored in thedatabase 502 using the compression unit 105. The compression unit 105receives the weights as an input. The compression unit 105 then performsprocess 200C to generate the data that is stored in the database 502.

In some instances, the k value used by the compression unit 105 isdynamically changed through the training process. For instance, in earlyiterations of the training process, higher levels of noise in theweights can be tolerated. Accordingly, larger k values are used. In thissituation, the trainer 514 passes smaller arguments to the compressionunit 105. However, as the training progresses and the weights begin toconverge, the training process is less tolerant of noise in the weights.Therefore, smaller k values are used. In this situation, the trainer 514passes smaller k arguments to the compression unit 105.

FIG. 6A is a flow diagram of an evaluation process 600A. In step 610 thecompressed weights are retrieved. Then in step 620, the restorationprocess 200D is performed on the compressed weights retrieved togenerate restored weights. Then an output is generated in step 630 by aneuro network based on the restored weights.

FIG. 6B is a flow diagram of a training process 600B. In step 605 thecompressed weights are retrieved. Then in step 615, the restorationprocess 200D is performed on the compressed weights retrieved togenerate restored weights. An output is then generated in step 625 by aneural network using the restored weights. A training process is thenperformed on the output in step 635. The result of the training processis new weights. The new weights are then compressed in step 645according to process 200C. The compressed new weights are then stored instep 655.

It should be understood that many variations are possible based on thedisclosure herein. Although features and elements are described above inparticular combinations, each feature or element may be used alonewithout the other features and elements or in various combinations withor without other features and elements.

The methods provided may be implemented in a general purpose computer, aprocessor, or a processor core. Suitable processors include, by way ofexample, a general purpose processor, a special purpose processor, aconventional processor, a digital signal processor (DSP), a plurality ofmicroprocessors, one or more microprocessors in association with a DSPcore, a controller, a microcontroller, Application Specific IntegratedCircuits (ASICs), Field Programmable Gate Arrays (FPGAs) circuits, anyother type of integrated circuit (IC), and/or a state machine. Suchprocessors may be manufactured by configuring a manufacturing processusing the results of processed hardware description language (HDL)instructions and other intermediary data including netlists (suchinstructions capable of being stored on a computer readable media). Theresults of such processing may be maskworks that are then used in asemiconductor manufacturing process to manufacture a processor whichimplements aspects of the embodiments.

The methods or flow charts provided herein may be implemented in acomputer program, software, or firmware incorporated in a non-transitorycomputer-readable storage medium for execution by a general purposecomputer or a processor. Examples of non-transitory computer-readablestorage mediums include a read-only memory (ROM), a random access memory(RAM), a register, cache memory, semiconductor memory devices, magneticmedia such as internal hard disks and removable disks, magneto-opticalmedia, and optical media such as CD-ROM disks, and digital versatiledisks (DVDs).

What is claimed is:
 1. A data storage and retrieval method comprising:receiving data; truncating a predetermined number of bits of the data toform truncated data, wherein the predetermined number of bits isdetermined based on any one or a combination of: a software-definedparameter; a parameter passed in an instruction; a number of trainingiterations of a machine learning system; available resources of adevice; metrics associated with previously compressed data; and a fixednumber; compressing the truncated data to form compressed data; andstoring the compressed data in a memory or transmitting the compresseddata to a receiving system.
 2. The method of claim 1, furthercomprising: retrieving the compressed data; decompressing the compresseddata to form decompressed truncated data; and concatenating restorationbits to the decompressed truncated data to form restored data.
 3. Themethod of claim 2, wherein the restoration bits are selected by samplingfrom a statistical distribution.
 4. The method of claim 3, wherein thestatistical distribution is a non-parametric distribution.
 5. The methodof claim 4, wherein the non-parametric distribution is determined basedon previously restored data.
 6. The method of claim 3, wherein thestatistical distribution is a parametric distribution.
 7. The method ofclaim 6, wherein the parametric distribution is determined based onpreviously restored data.
 8. The method of claim 1, wherein thepredetermined number of bits is determined based on previouslycompressed data or a desired level of noise.
 9. The method of claim 1,further comprising: receiving the predetermined number of bits via asoftware passed argument.
 10. A data storage and retrieval systemcomprising: a memory; and a processor communicatively coupled to thememory, wherein the processor: retrieves data from the memory, truncatesa predetermined number of bits of the data to form truncated data,wherein the predetermined number of bits is determined based on any oneor a combination of: a software-defined parameter; a parameter passed inan instruction; a number of training iterations of a machine learningsystem; available resources of a device; metrics associated withpreviously compressed data; and a fixed number; compresses the truncateddata to from compressed data; and stores the compressed data in thememory or transmits the compressed data to a receiving system.
 11. Thesystem of claim 10, where in the processor further: retrieves thecompressed data; decompresses the compressed data to form decompressedtruncated data; and concatenates restoration bits to the decompressedtruncated data to form restored data.
 12. The system of claim 11,wherein the restoration bits are selected by sampling from a statisticaldistribution.
 13. The system of claim 12, wherein the statisticaldistribution is a non-parametric distribution.
 14. The system of claim13, wherein the non-parametric distribution is determined based onpreviously restored data.
 15. The system of claim 12, wherein thestatistical distribution is a parametric distribution.
 16. The system ofclaim 15, wherein the parametric distribution is determined based onpreviously restored data.
 17. The system of claim 10, wherein thepredetermined number of bits is determined based on previouslycompressed data or a desired level of noise.
 18. The system of claim 10,wherein the processor further: receiving the predetermined number ofbits via a software passed argument.
 19. A non-transitory computerreadable storage medium storing instructions, that when executed by aprocessor cause the processor to: retrieve data from a memory, truncatea predetermined number of bits of the data to form truncated data,wherein the predetermined number of bits is determined based on any oneor a combination of: a software-defined parameter; a parameter passed inan instruction; a number of training iterations of a machine learningsystem; available resources of a device; metrics associated withpreviously compressed data; and a fixed number; compress the truncateddata to form compressed data; and store the compressed data in thememory or transmit the compressed data to a receiving system.
 20. Thenon-transitory computer readable storage medium of claim 19, wherein theinstructions further cause the processor to: retrieve the compresseddata; decompress the compressed data to form decompressed truncateddata; and concatenate restoration bits to the decompressed truncateddata to form restored data.